<template>
  <div>
    <pageHeader title="店铺管理"></pageHeader>
    <pageMain padding="0" background="transparent">
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="store_name" label="名称" align="center">
        </el-table-column>
        <el-table-column prop="date" label="LOGO"> </el-table-column>
        <el-table-column prop="operate_type" label="主营类目" align="center">
        </el-table-column>
        <el-table-column prop="store_type" label="类型" align="center">
        </el-table-column>
        <el-table-column prop="store_grade" label="店铺等级" align="center">
        </el-table-column>
        <el-table-column
          prop="create_date"
          label="创建时间"
          width="190"
          align="center"
        >
        </el-table-column>
        <el-table-column prop="state" label="状态" align="center">
        </el-table-column>
        <el-table-column label="操作" fixed="right" width="180" align="center">
          <template slot-scope="scope">
            <div class="table-options overall-flex">
              <el-link
                type="primary"
                size="mini"
                plain
                @click="clickInfo(scope.row)"
                >查看</el-link
              >
              <el-link
                type="primary"
                size="mini"
                plain
                @click="clickEdit(scope.row)"
                >编辑</el-link
              >
              <el-link
                type="danger"
                size="mini"
                plain
                @click="clickRemove(scope.row)"
                >删除</el-link
              >
            </div>
          </template>
        </el-table-column>
      </el-table>
    </pageMain>
  </div>
</template>

<script>
import pageHeader from "~/page-header/page-header.vue";
import pageMain from "~/page-main/page-main.vue";
import shoppingAPI from "@/api/shopping";
export default {
  components: { pageHeader, pageMain },
  data() {
    return {
      tableData: [],
    };
  },

  methods: {
    getStoreList() {
      shoppingAPI
        .storeList()
        .then((res) => {
          let data = res.data;
          this.tableData = data;
        })
        .catch((err) => {
          console.log(err);
        });
    },
    clickInfo(row) {
      console.log(row);
      this.$router.push({
        name: "shoppingManagementStoreInfo",
        query: {
          storeid: row.id,
        },
      });
    },
    clickEdit(row) {
      console.log(row);
    },
    clickRemove(row) {
      console.log(row);
    },
  },

  created() {
    this.getStoreList();
  },
};
</script>

<style scoped>
.table-options {
  width: 100%;
  justify-content: space-around;
}
</style>
